Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Don't add official Ethereum bootnodes as required peers #5628

Merged
merged 2 commits into from
Jun 15, 2019

Conversation

halfalicious
Copy link
Contributor

@halfalicious halfalicious commented Jun 14, 2019

Add them to the node table rather than as required peers - this results in us interacting with them via discovery (which is where their real value lies) and if we can validate the endpoint proof, adding them as optional peers and trying to connect to them via devp2p. However, we stop trying to connect to them if we get disconnected for a critical reason (e.g. they're on a different network or we don't have any common capabilities). If we get disconnected for a non-critical reason (e.g. a TCP error), we'll try to reconnect at increasing intervals.

This makes more sense than adding them as required peers which results in us endlessly trying to connect to them via devp2p, regardless of the disconnect reason - note that many of them are on different Ethereum networks and also don't appear to be running devp2p so they don't support syncing, so we never end up being able to connect to them anyway. In practice, I believe we're only ever able to peer with 1 node out of our full list.

Add them to the node table rather than as required peers - this results in us interacting with them via discovery (which is where their real value lies) and if we can validate the endpoint proof, adding them as optional peers and trying to connect to them via devp2p. However, we stop trying to connect to them if we get disconnected for a critical reason (e.g. they're on a different network or we don't have any common capabilities).

This makes more sense than adding them as required peers which results in us endlessly trying to connect to them via devp2p, regardless of the disconnect reason - note that many of them are on different Ethereum networks and also don't appear to be running devp2p so they don't support syncing.
@halfalicious
Copy link
Contributor Author

We should wait until #5624 is merged to merge this (not strictly required but this work makes more sense after 5624 is in)

@halfalicious halfalicious changed the title [WIP] Add official Ethereum bootnodes to node table rather than as required peers [WIP] Don't add official Ethereum bootnodes as required peers Jun 14, 2019
@halfalicious
Copy link
Contributor Author

Still need to test these changes and investigate the failing tests

Copy link
Member

@gumb0 gumb0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. Changes in aleth/main.cpp shouldn't affect any tests, so the failures are weird

@halfalicious halfalicious changed the title [WIP] Don't add official Ethereum bootnodes as required peers Don't add official Ethereum bootnodes as required peers Jun 15, 2019
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@505aead). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5628   +/-   ##
=========================================
  Coverage          ?   62.63%           
=========================================
  Files             ?      350           
  Lines             ?    29697           
  Branches          ?     3344           
=========================================
  Hits              ?    18602           
  Misses            ?     9889           
  Partials          ?     1206

@halfalicious halfalicious merged commit 17419c2 into master Jun 15, 2019
@halfalicious halfalicious deleted the make-bootnodes-optional branch June 15, 2019 04:39
@chfast
Copy link
Member

chfast commented Jun 17, 2019

This is good change, because the predefined bootnodes are to be only used to bootstrap the p2p. Then we should rather depend on other peers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants